const wxRequest = (type, myUrl, data) => {
  //console.log(data);
  return new Promise((resolve, reject) => {
    wx.request({
      url: myUrl,
      method: type,
      data: data,
      success: res => resolve(res),
      fail: ee => {
        reject(ee.errMsg)
      }
    })
  })
}
const hzDataRequest = (type, url, data, header) => {
  return new Promise((resolve, reject) => {
    wx.request({
      url: url,
      header: header,
      method: type,
      data: data,
      success: res => resolve(res),
      fail: ee => {
        reject(ee.errMsg)
      }
    })
  })
}

module.exports = {
  wxRequest,
  hzDataRequest
}